#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define OJ_TEST 0
#define LOCAL_TEST 0

#define M 901

static int max(int a, int b){ return a>b?a:b; }
static int min(int a, int b) { return a<b?a:b; }

struct point{
	int x, y;
};
struct point pt[M];
int pt_line(int i, int j, int k){
	int x1, x2, y1, y2;
	x1 = pt[i].x - pt[j].x;
	x2 = pt[i].x - pt[k].x;
	y1 = pt[i].y - pt[j].y;
	y2 = pt[i].y - pt[k].y;
	return (x1*y2-x2*y1)==0;
}
static void solve(void){
	int n, i, j, k;
	char line[18];
	int ans, tmp, cs;
	scanf("%d\n", &cs);
	for(; cs>0; --cs){
		n=0;
		while(gets(line)){
			if(line[0]=='\0') break;
			sscanf(line, "%d%d", &pt[n].x, &pt[n].y);
			++n;
		}
		for(ans=2, i=0; i<n; ++i){
			for(j=i+1; j<n; ++j){
				if(i==j) continue;
				for(tmp=2,k=j+1; k<n; ++k){
					if(i==k || j==k) continue;
					if(pt_line(i, j, k)) ++tmp;
				}
				if(tmp>ans) ans=tmp;
			}
		}
		printf("%d\n", ans);
		if(cs>1){
			printf("\n");
		}
	}

}
#if OJ_TEST
	int main(int ac, char *av[]){
		solve();
		return 0;
	}
#elif  LOCAL_TEST
	void run(void){
		solve();
	}

#else

#endif
